package com.example.sys.controller;

import com.example.common.utils.R;
import com.example.sys.service.CommonService;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;

@RestController
public class CommonController {

    @Resource
    private CommonService commonService;

    @PostMapping("/login")
    public R login(@RequestBody String params, HttpServletRequest request) {
        return commonService.login(params, request);
    }

    @PostMapping("/routes")
    public R getRoutes(@RequestBody String params) {
        return commonService.getRoutes(params);
    }
}
